package com.dolphin.aiagentplatform.ai.message;

import lombok.Data;
import org.springframework.ai.chat.messages.Message;

import java.util.Date;

@Data
public class MessageVO {

    private String role;
    private String content;
    private Date createTime;

    public MessageVO() {
    }

    public MessageVO(Message message) {
        switch (message.getMessageType()) {
            case SYSTEM -> role = "system";
            case USER -> role = "user";
            case ASSISTANT -> role = "assistant";
            case TOOL -> role = "tool";
            default -> role = "";
        }
        this.content = message.getText();
        this.createTime = new Date();
    }
}
